package com.easyaop.api.around;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.aopalliance.aop.Advice;

/**
 * @author lipan
 * @since 2025-02-22
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
public @interface CustomOrigin {
    String DEFAULT = "";

    /**
     * Returns the pattern the annotated parameter should be assigned. By default, the
     * {@link Advice.Origin#toString()} representation
     * of the method is assigned. Alternatively, a pattern can be assigned where:
     * <ul>
     * <li>{@code #t} inserts the method's declaring type.</li>
     * <li>{@code #m} inserts the name of the method ({@code <init>} for constructors and {@code <clinit>} for static
     * initializers).</li>
     * <li>{@code #d} for the method's descriptor.</li>
     * <li>{@code #s} for the method's signature.</li>
     * <li>{@code #r} for the method's return type.</li>
     * <li>{@code #p} for the property's name.</li>
     * </ul>
     * Any other {@code #} character must be escaped by {@code \} which can be escaped by itself. This property is
     * ignored if the annotated
     * parameter is of type {@link Class}.
     *
     * @return The pattern the annotated parameter should be assigned.
     */
    String value() default DEFAULT;

    boolean cache() default true;

    boolean privileged() default false;


}
